<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" +
            request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>回馈</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="shortcut icon" href="<%=basePath%>static/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="<%=basePath%>static/css/font.css">
    <link rel="stylesheet" href="<%=basePath%>static/css/xadmin.css">
    <link rel="stylesheet" href="<%=basePath%>static/css/bootstrap.css">
    <script type="text/javascript" src="<%=basePath%>static/js/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="<%=basePath%>static/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="<%=basePath%>static/js/jqPaginator.js"></script>
    <script type="text/javascript" src="<%=basePath%>static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="<%=basePath%>static/js/xadmin.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/pintuer.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/admin.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/pintuer.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/admin.css">
</head>
<body>
<form>
    <div class="form-group">
        <div class="label">
            <h1><input type="reset" id="username" name="username">体检结果回馈</h1>
        </div>
        <div class="field">
            <textarea class="input" id="feedback"></textarea>
            <div class="tips"></div>
        </div>
    </div>
    体检状态：<input type="text" id="state"><br><br><br>
    <input type="button" class="button border-blue" value="提交" onclick="reply()">
</form>

<script>
    $(document).ready(function () {
        $("#username").val(localStorage.getItem("username"));
        //$("#appointId").val(localStorage.getItem("appointId"));
    })

    function reply() {

        $.ajax({
            url: "../doctor/reply",
            type: "post",
            dataType: "json",
            data: {
                "state": $("#state").val(),
                "feedback": $("#feedback").val(),
                "name": $("#username").val(),
            },
            success: function (data) {
                if (data.code == 200) {
                   // alert("提交成功");
                }
            }, error: function () {
                alert("提交成功");
                location.replace(location.href);
                window.close();
                /*$.alerts.alert("点击下方确认按钮刷新页面", "温馨提示","确定",function(){
                    window.location.reload();
                });*/
            }
        })
    }
</script>
</body>
</html>
